import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 平台简介信息 */
export interface AboutPlatform {
          id: number; // id
          content?: string; // 关于平台
          updateTime?: string | Dayjs; // 更新时间
  }

// 平台简介 API
export const AboutPlatformApi = {
  // 查询平台简介分页
  getAboutPlatformPage: async (params: any) => {
    return await request.get({ url: `/biz/about-platform/page`, params })
  },

  // 查询平台简介详情
  getAboutPlatform: async (id: number) => {
    return await request.get({ url: `/biz/about-platform/get?id=` + id })
  },

  // 新增平台简介
  createAboutPlatform: async (data: AboutPlatform) => {
    return await request.post({ url: `/biz/about-platform/create`, data })
  },

  // 修改平台简介
  updateAboutPlatform: async (data: AboutPlatform) => {
    return await request.put({ url: `/biz/about-platform/update`, data })
  },

  // 删除平台简介
  deleteAboutPlatform: async (id: number) => {
    return await request.delete({ url: `/biz/about-platform/delete?id=` + id })
  },

  /** 批量删除平台简介 */
  deleteAboutPlatformList: async (ids: number[]) => {
    return await request.delete({ url: `/biz/about-platform/delete-list?ids=${ids.join(',')}` })
  },

  // 导出平台简介 Excel
  exportAboutPlatform: async (params) => {
    return await request.download({ url: `/biz/about-platform/export-excel`, params })
  },
}